<?
require_once("config.php");
/*
	About: What's this?
	
	Miscellaneous functions. Not required for normal code running, but useful for logs and reports.
*/

function reportIssueAdmin($text, $level)
{
	$TS= date('l jS \of F Y h:i:s A');
	mail("gjulian93@gmail.com", "$level: problema en Twitfav at $TS", $text);
	$myFile = "logs";
	$fh = fopen($myFile, 'a');
	fwrite($fh, "\n\n $level: problema en Twitfav at $TS \n $text");
	fclose($fh);
}

function logs($string)
{
	// Write something to the log (encrypted, of course).
	$fr = fopen("/nonroot/logs.txt", "a");
	$string = "\n".date(DATE_RFC822).": ".base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5(CRYPT_KEY), $string, MCRYPT_MODE_CBC, md5(md5($key))));
	fwrite ($fr, $string);
	fclose ($fh);
	return true;
}
?>